home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / LIFE_SIM / VERSION_ / HANDLEDI.C < prev    next >
Text File  |  1992-03-12  |  972b  |  51 lines

  1. /* Cell Proj 1.0 */
  2.  
  3. #include "MacProto.h"
  4. #include "Cell_Proto.h"
  5. #include "Cell_Definitions.h"
  6. #include "Cell_Variables.h"
  7.  
  8. DoPreCheck()
  9. {
  10.     char    theChar;
  11.  
  12.     switch ( gTheEvent.what )
  13.     {
  14.         case autoKey:
  15.         case keyDown:
  16.             theChar = gTheEvent.message & charCodeMask;
  17.             if (( gTheEvent.modifiers & cmdKey ) != 0 )
  18.                 HandleMenuChoice( MenuKey( theChar ));
  19.             break;
  20.         case activateEvt:
  21.             if ( (WindowPtr)gTheEvent.message == gCellInfoDialog )
  22.             {
  23.                 if (( gTheEvent.modifiers & activeFlag ) != 0 )
  24.                 {
  25.                     SetPort( gCellInfoDialog );
  26.                     SelectWindow( gCellInfoDialog );
  27.                 }
  28.                 else
  29.                 {
  30.                     SetPort( gCellInfoDialog );
  31.                 }
  32.             }
  33.             break;
  34.         case updateEvt:
  35.             if ( (WindowPtr)gTheEvent.message == gCellInfoDialog )
  36.             {
  37.                 BeginUpdate( gCellInfoDialog );
  38.                 DrawDialog( gCellInfoDialog );
  39.                 EndUpdate( gCellInfoDialog );
  40.             }
  41.             break;
  42.     }
  43. }            
  44.  
  45. HandleDialog()
  46. {
  47.     int            itemHit;
  48.     DialogPtr    theDialog;
  49.     
  50.     DialogSelect( &gTheEvent, &theDialog, &itemHit );
  51. }